Retrieves the hour from the given DateTime object.
int @DateTimeHour(object datetime);
Parameters
object datetime: The created DateTime object
Return Value
Returns the hour.
Example
t = @DateTimeNow();
year = @DateTimeYear(t);
month = @DateTimeMonth(t);
day = @DateTimeDay(t);
hour = @DateTimeHour(t);
minute =
@DateTimeMinute(t);
second = @DateTimeSecond(t);
millisecond =
@DateTimeMillisecond(t);
dow = @DateTimeDayOfWeek(t);
doy =
@DateTimeDayOfYear(t);
@sprintf(buf, "%d-%d-%d %02d:%02d:%02d.%03d
dow=%d,doy=%d", year, month, day, hour, minute, second, millisecond, dow, doy);
@Message(buf);
Description: Gets the current time, creates a DateTime object, and reads each element to display it as a message.
Version Information
Supported Version: 10.3.0 or Higher
Related Helps